core: While walking mtrees during commit, ensure the referenced path is resolved
authorColin Walters <walters@verbum.org>
Wed, 11 Jan 2012 18:42:59 +0000 (13:42 -0500)
committerColin Walters <walters@verbum.org>
Wed, 11 Jan 2012 18:42:59 +0000 (13:42 -0500)
This gives us a clean error instead of an assertion.

src/libostree/ostree-repo.c

index 92d15f4a0d172bb5ab7ac6849715a60040e20df6..06fe37f222695e51c31a6fa28caca8499fc125a6 100644 (file)
@@ -1437,6 +1437,9 @@ ostree_repo_stage_directory_to_mtree (OstreeRepo           *self,
 
   if (repo_dir)
     {
+      if (!ostree_repo_file_ensure_resolved (repo_dir, error))
+        goto out;
+
       ostree_mutable_tree_set_metadata_checksum (mtree, ostree_repo_file_get_checksum (repo_dir));
       repo_dir_was_empty = 
         g_hash_table_size (ostree_mutable_tree_get_files (mtree)) == 0